package com.ocean.product.service.impl;

import com.ocean.product.domain.OProductReport;
import com.ocean.product.mapper.OProductReportMapper;
import com.ocean.product.service.IOProductReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

/**
 * @author msy
 * @date 2023/3/6
 */
@Service
public class OProductReportServiceImpl implements IOProductReportService {

    @Autowired
    private OProductReportMapper productReportMapper;

    @Override
    public List<OProductReport> selectOProductReportList(OProductReport oProductReport) {
        return productReportMapper.selectOProductReportList(oProductReport);
    }

    @Override
    public int save(OProductReport productReport) {
        productReport.setId(UUID.randomUUID().toString());//給id賦值
        return productReportMapper.insertOProductReport(productReport);
    }

    /**
     * 早于晚传时间列表
     * @return
     */
    @Override
    public List<OProductReport> getLessThanLateTransmissionList() {
        return productReportMapper.getLessThanLateTransmissionList();
    }

    @Override
    public int updateOProductReport(OProductReport productReport) {
        return productReportMapper.updateOProductReport(productReport);
    }

    /**
     * 等于晚传时间/时间+1列表
     * @return
     */
    @Override
    public List<OProductReport> getEqualLateTransmissionList() {
        return productReportMapper.getEqualLateTransmissionList();
    }

    /**
     * 小于补传，大于晚传列表
     * @return
     */
    @Override
    public List<OProductReport> getNeedTransmissionList() {
        return productReportMapper.getNeedTransmissionList();
    }

    /**
     * 基于getNeedTransmissionList条件，大于短信提醒日
     * @return
     */
    @Override
    public List<OProductReport> getNeedSendsmsList() {
        return productReportMapper.getNeedSendsmsList();
    }
}
